package cn.tedu.boot51.mapper;

import cn.tedu.boot51.entity.Image;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ImageMapper {
    @Insert("insert into image values(null,#{title},#{url})")
    void insert(Image image);

    @Select("select * from image")
    List<Image> select();

    @Delete("delete  from image where id=#{id} ")
    void delete(int id);

    @Select("select url from image where id=#{id}")
    Image selectById(int id);
}
